#ifndef __SPI_H__
#define __SPI_H__

#include "stm32f4xx_spi.h"

#define SD_SPI            SPI2
#define SD_SPI_RCC        RCC_APB1Periph_SPI2


#define SD_SCK_PIN        GPIO_Pin_13
#define SD_SCK_GPIO       GPIOB
#define SD_SCK_RCC        RCC_AHB1Periph_GPIOB
#define SD_SCK_SOURCE     GPIO_PinSource13
#define SD_SCK_AF         GPIO_AF_SPI2

#define SD_MISO_PIN       GPIO_Pin_14
#define SD_MISO_GPIO      GPIOB
#define SD_MISO_RCC       RCC_AHB1Periph_GPIOB
#define SD_MISO_SOURCE    GPIO_PinSource14
#define SD_MISO_AF        GPIO_AF_SPI2

#define SD_MOSI_PIN       GPIO_Pin_15
#define SD_MOSI_GPIO      GPIOB
#define SD_MOSI_RCC       RCC_AHB1Periph_GPIOB
#define SD_MOSI_SOURCE    GPIO_PinSource15
#define SD_MOSI_AF        GPIO_AF_SPI2

#define SD_CS_PIN         GPIO_Pin_12
#define SD_CS_GPIO        GPIOB
#define SD_CS_RCC         RCC_AHB1Periph_GPIOB

void SPI_Configuration(void);
#endif